{% extends 'mysite/base.html' %}
{% load blog_tags %}
{% block content %}
    {% for post in posts %}
        <div class="post">
            <h2><a href="{% url 'blog.views.post_detail' pk=post.pk %}">{{ post.title }}</a></h2>

            <div class="info">
                <span class="date">创建时间: {{ post.created_date|date:'Y年m月d日' }}</span>

                <div class="fixed"></div>
            </div>
            <div class="content">
                <p>
                    {% autoescape off %}
                        {{ post.text|more:post.id }}
                    {% endautoescape %}
                </p>
            </div>
            <div class="under">
                <span class="categories">分类: </span>
                <span>
                    <a href="{% url 'blog.views.post_list_by_category' cg=post.category.name %}"
                       rel="category tag">{{ post.category.name }}
                    </a>
                </span>
                <span class="tags">标签: </span>
                <span>
                    {% for tg in post.tags.all %}
                        <a href="{% url 'blog.views.post_list_by_tag' tag=tg.name %}"
                           rel="tag">{{ tg.name }}</a>&nbsp;
                    {% endfor %}
                </span>
            </div>
        </div>
    {% endfor %}
{% endblock %}
